package cn.software.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

/**
 * 
 * @TableName topic
 */
@TableName(value ="topic")
public class Topic implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 题面
     */
    private String content;

    /**
     * 1:单选 2:多选 3:简答题 4:判断题
     */
    private Integer type;

    /**
     * 单选多选判断有，简答题为空
     */
    @TableField("`option`")
    private String option;

    /**
     * 答案
     */
    private String answer;

    /**
     * 题目对应的科目
     */
    private Integer subjectId;

    /**
     * 
     */
    private Integer score;


    /**
     * 逻辑删除
     */
    private int isDeleted;

    public int getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(int isDeleted) {
        this.isDeleted = isDeleted;
    }



    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    public Integer getId() {
        return id;
    }

    /**
     * 
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 题面
     */
    public String getContent() {
        return content;
    }

    /**
     * 题面
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 1:单选 2:多选 3:简答题 4:判断题
     */
    public Integer getType() {
        return type;
    }

    /**
     * 1:单选 2:多选 3:简答题 4:判断题
     */
    public void setType(Integer type) {
        this.type = type;
    }

    /**
     * 单选多选判断有，简答题为空
     */
    public String getOption() {
        return option;
    }

    /**
     * 单选多选判断有，简答题为空
     */
    public void setOption(String option) {
        this.option = option;
    }

    /**
     * 答案
     */
    public String getAnswer() {
        return answer;
    }

    /**
     * 答案
     */
    public void setAnswer(String answer) {
        this.answer = answer;
    }

    /**
     * 题目对应的科目
     */
    public Integer getSubjectId() {
        return subjectId;
    }

    /**
     * 题目对应的科目
     */
    public void setSubjectId(Integer subjectId) {
        this.subjectId = subjectId;
    }

    /**
     * 
     */
    public Integer getScore() {
        return score;
    }

    /**
     * 
     */
    public void setScore(Integer score) {
        this.score = score;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Topic other = (Topic) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getOption() == null ? other.getOption() == null : this.getOption().equals(other.getOption()))
            && (this.getAnswer() == null ? other.getAnswer() == null : this.getAnswer().equals(other.getAnswer()))
            && (this.getSubjectId() == null ? other.getSubjectId() == null : this.getSubjectId().equals(other.getSubjectId()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getOption() == null) ? 0 : getOption().hashCode());
        result = prime * result + ((getAnswer() == null) ? 0 : getAnswer().hashCode());
        result = prime * result + ((getSubjectId() == null) ? 0 : getSubjectId().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", content=").append(content);
        sb.append(", type=").append(type);
        sb.append(", option=").append(option);
        sb.append(", answer=").append(answer);
        sb.append(", subjectId=").append(subjectId);
        sb.append(", score=").append(score);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}